#!/usr/bin/env python
#-*- coding:utf-8 -*-

import sys
import os
import re
import traceback

sys_executable = sys.executable
if not sys_executable.endswith('python.exe') and not re.findall('python\d*$', sys_executable):
    os.environ['DB_CHECKER_DIR'] = os.path.dirname(sys.executable)

from utils.log import logger

from database_checker import DatabaseChecker

if __name__ == '__main__':
    logger.info('--------------------------开始运行--------------------------')
    try:
        db_checker = DatabaseChecker()
        db_checker.run()
       
    except Exception:
        logger.error('运行出错：%s' % traceback.format_exc())
    logger.info('--------------------------结束运行--------------------------')
